﻿<%@ WebHandler Language="C#" Class="Test" %>

using System;
using System.Web;
using System.Collections.Generic;

using EHSubmit.Model;
using EHSubmit.Util;

public class Test : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/plain";
/*
        IList<User> list = new List<User>();
        
        
        User user = new User();
        user.ID = "0120000";
        user.Name = "Bruce";
        user.Phone = "13575068960";
        user.Pwd = "123456";
        user.Sex = "male";
        user.Email = "lingtianlan@gmail.com";
        user.LastLoginTime = new DateTime(2009, 12, 11);

        list.Add(user);

        User u2 = new User();

        u2.ID = "sfsdf";
        u2.LastLoginTime = new DateTime(2009, 11, 1);

        list.Add(u2);
        
        string result = JsonHelper.Serialize(list);

        context.Response.Write(result);
        
   
        string str = @"[{""ID"":""0120000"",""Pwd"":""123456"",""Name"":""Bruce"",""Sex"":""male"",""Birthday"":new Date(-62135596800000),""Photo"":null,""Email"":""lingtianlan@gmail.com"",""Phone"":""13575068960"",""Institute"":null,""Department"":null,""RoleId"":0,""Createdtime"":new Date(-62135596800000),""LoginCount"":0,""LastLoginId"":null,""LastLoginTime"":new Date(1260460800000)},{""ID"":""sfsdf"",""Pwd"":null,""Name"":null,""Sex"":null,""Birthday"":new Date(-62135596800000),""Photo"":null,""Email"":null,""Phone"":null,""Institute"":null,""Department"":null,""RoleId"":0,""Createdtime"":new Date(-62135596800000),""LoginCount"":0,""LastLoginId"":null,""LastLoginTime"":new Date(1257004800000)}]";

        List<User> list2 = JsonHelper.Deserialize<List<User>>(str);

        
        context.Response.Write(list2[0].ID);*/
        //

//       string str = @"{""a"":""123"",""b"":""ddd""}";

     //   JsonHelper jh = new JsonHelper(str);
        
       // context.Response.Write(jh.GetArrayParam("a"));
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}